Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Generate OSM XML from a stream of objects matching OSM JSON
npm install obj2osm
var toxml = require('../')
var from2Array = require('from2-array')
var input = require('../test/fixture.json')
var bounds = {
minlat: 38.89958342598271,
maxlat: 38.90385833966776,
minlon: -77.02514648437499,
maxlon: -77.01965332031249
}
from2Array.obj(input)
.pipe(toxml({bounds: bounds}))
.pipe(process.stdout)
output:
$ node osm.js
<?xml version="1.0" encoding="UTF-8"?><osm version="0.6" generator="obj2osm"><bounds minlat="38.89958342598271" maxlat="38.90385833966776" minlon="-77.02514648437499" maxlon="-77.01965332031249"/><node lat="38.90094671136515" lon="-77.02313139881134" timestamp="2015-12-31T20:50:35.826Z" id="1db08fd46c5a7c01" version="334fd5b5114e0ae69c151978640cd5692c9fb639c7565ba48b0cd2700e1d8547"/><way timestamp="2015-12-31T20:50:35.842Z" id="29ac0c8f50e630e9" version="57f9ec2913db5e568976372afa8997255fdb614cff48ca01565f2ddee3687bc8"><nd ref="1db08fd46c5a7c01"/><nd ref="8c50fa92c3ce91d7"/><nd ref="83c1be761a9f4148"/><nd ref="1db08fd46c5a7c01"/><tag k="area" v="yes"/></way><node lat="38.90068996279713" lon="-77.02327892030715" timestamp="2015-12-31T20:50:35.849Z" id="8c50fa92c3ce91d7" version="8f32080b4501459d8a904c568e2a0c7de92de435fab8c7d16ae2b39851046991"><tag k="amenity" v="cafe"/></node><relation timestamp="2015-12-31T20:50:35.855Z" id="83c1be761a9f4148" version="0443c3916e92250149c8086ed21b2265cb6af161dbf63a17e30a7d3c8a0cb0b1"><member ref="8c50fa92c3ce91d7" type="node" role=""/></relation></osm>
var toxml = require('obj2osm')
Where:
opts.root
- Root XML element (default: osm
, set to null
to output XML with no root)opts.generator
- Generator attribute for the root element (default: obj2osm
)opts.bounds
- Optional bounds to include at start of XML, either {minlat: <Number>, maxlat: <Number>, minlon: <Number>, maxlon: <Number>}
or [[minLat, maxLat], [minLon, maxLon]]
Returns a transform object stream
that expects a stream of objects matching OSM JSON format as input and produces osm xml output or osmChange XML output if input objects have an action property set to one of: create|modify|delete
.
Node object format:
node.type
- 'node'
node.id
- id stringnode.version
- version stringnode.lat
- latitude in degreesnode.lon
- longitude in degreesnode.tags
- Object of tag key-value pairs: {tagKey: 'tagValue', amenity: 'cafe'}
Way object format:
way.type
- 'way'
way.id
- id stringway.version
- version stringway.nodes
- array of node IDsway.tags
- Object of tag key-value pairsRelation object format:
relation.type
- relation.type
relation.id
- id stringrelation.version
- version stringrelation.members
- array of member objects: {type: 'node|way|relation', ref: 'id', role: 'role'}
relation.tags
- Object of tag key-value pairsPRs welcome. Please follow JS Standard Style.
BSD
[2.0.1] - 2016-08-24
type
property (not one of node|way|relation|bounds|changeset
)FAQs
Generate OSM XML from a stream of OSM JSON objects
The npm package obj2osm receives a total of 194 weekly downloads. As such, obj2osm popularity was classified as not popular.
We found that obj2osm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.